from django.conf.urls import patterns, url
from .views import catalog, subspecies, show_birds, go_cart,  bird_detail

urlpatterns = patterns('',
    url(r'^carrito$', 'apps.catalog.views.remove_all_to_cart'),
    url(r'^$', catalog.as_view(), name='catalog_base'),       
    url(r'especie/(?P<id>\d+)/$', subspecies.as_view(), name='subspecies'), 
    url(r'especie/(?P<id>\d+)/(?P<idSub>\d+)/$', show_birds.as_view(), name='birds'), 
    url(r'^cart/$', 'apps.catalog.views.go_cart', name='go_cart'),
    url(r'^RegistroCompra/(?P<pid>[0-9]+)$', 'apps.catalog.views.registroCompra', name='registro_Compra'),
    url(r'^especie/(?P<id>\d+)/detalles/$', bird_detail.as_view(), name='detail_bird'), 
    url(r'anadirCarrito/(?P<pid>[0-9]+)/(?P<quantity>[0-9]+)/$', 'apps.catalog.views.add_to_cart'),
    url(r'anadirCarrito/(?P<pid>[0-9]+)/$', 'apps.catalog.views.remove_from_cart'),
    url(r'^loginCompra/$', 'django.contrib.auth.views.login', {'template_name':'home/loginCompra.html'}, name='loginCompra'),
    
)